﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace TCS.Web
{
    public partial class index : System.Web.UI.Page
    {
        protected string pics;
        protected string links;
        protected string texts;
        protected void Page_Load(object sender, EventArgs e)
        {
            
            //BindData(); 
            //BindImg();
        }
        //private void BindData()
        //{
        //    TCS.BLL.NewsManage.News bll = new TCS.BLL.NewsManage.News();
        //    DataSet ds = bll.GetNewsTopList(8, 5, " and IsTop=1");
        //    this.rptNewsList.DataSource = ds;
        //    this.rptNewsList.DataBind();

        //    DataSet dsTitle = new TCS.BLL.NewsManage.News().GetNewsTopList(1, 4, " and IsTop=1");
        //    this.ltrTitle_Laws.Text ="<a target='_blank' href='show.aspx?id="+dsTitle.Tables[0].Rows[0]["NewsId"].ToString()+"'>"+ LTP.Common.CommClass.StringTruncat(dsTitle.Tables[0].Rows[0]["heading"].ToString(),15,".")+"</a>";
        //    this.ltrContent_Laws.Text = LTP.Common.CommClass.StringTruncat(LTP.Common.CommClass.checkStr(dsTitle.Tables[0].Rows[0]["Content"].ToString()),35, "..");
        //    string strwhereTitle_Laws = " and IsTop=1 and NewsId !=" + dsTitle.Tables[0].Rows[0]["NewsId"].ToString();
        //    this.rptList_Laws.DataSource = new TCS.BLL.NewsManage.News().GetNewsTopList(4, 4, strwhereTitle_Laws);
        //    this.rptList_Laws.DataBind();


        //    TCS.BLL.MemberInfo bllM = new TCS.BLL.MemberInfo();
        //    DataSet dsEntTitle = bllM.GetList(1, " IsDelete=0 ", " MemberID desc");
        //    this.ltrTitle_Ent.Text = "<a target='_blank' href='Exhibition/default.aspx?id=" + dsEntTitle.Tables[0].Rows[0]["MemberID"].ToString() + "'>" + LTP.Common.CommClass.StringTruncat(dsEntTitle.Tables[0].Rows[0]["EnName"].ToString(), 15, ".");
        //    this.ltrContent_Ent.Text = LTP.Common.CommClass.StringTruncat(LTP.Common.CommClass.checkStr(dsEntTitle.Tables[0].Rows[0]["AboutUs"].ToString()), 35, "..");
        //   // string strwhereEntTitle = "";
        //    DataSet dsEntList = bllM.GetList(4, " IsDelete=0 and MemberID!=" + dsEntTitle.Tables[0].Rows[0]["MemberID"].ToString(), " MemberID desc");
        //    this.rptEnList.DataSource = dsEntList;
        //    this.rptEnList.DataBind();

        //    this.rptNotice.DataSource = new TCS.BLL.NewsManage.News().GetNewsTopList(8, 6, " and IsTop=1");
        //    this.rptNotice.DataBind();

        //    this.rptList_Guide.DataSource = new TCS.BLL.NewsManage.News().GetNewsTopList(8, 7, " and IsTop=1");
        //    rptList_Guide.DataBind();
        //}
        //private void BindImg()
        //{
        //    TCS.BLL.Products.Product bll = new TCS.BLL.Products.Product();
        //    DataSet mSet = bll.GetBigImgListByCategoryID(5, "");//
            
        //    if (mSet.Tables[0].Rows.Count > 0)
        //    {
        //        for (int i = 0; i < mSet.Tables[0].Rows.Count; i++)
        //        {
        //            pics += LTP.Common.CommClass.RelativeWebRoot() + "ProductImages/" + mSet.Tables[0].Rows[i]["image"].ToString() + "|";
        //            links += "Exhibition/productshow2.aspx?pid=" + mSet.Tables[0].Rows[i]["ID"].ToString() + "_" + mSet.Tables[0].Rows[i]["MemberID"].ToString() + "|";
        //            texts += mSet.Tables[0].Rows[i]["Name"].ToString() + "|";
        //        }
        //        pics = pics.Substring(0, pics.Length - 1);
        //        links = links.Substring(0, links.Length - 1);
        //        texts = texts.Substring(0, texts.Length - 1);
        //    }
        //    //else
        //    //{
        //    //    return;
        //    //}
        //}
        //private bool SiteLevelCustomAuthenticationMethod(string strUserName, string strPassword)
        //{
        //    bool boolReturnValue = false;
        //    //string userName = LTP.Common.PageValidate.InputText(strUserName.Trim(), 30);
        //    //string Password = LTP.Common.PageValidate.InputText(strPassword.Trim(), 30);
        //    return boolReturnValue;//new TCS.BLL.MemberInfo().Exists(userName, Password);
        //}

        //protected void imgbtnLogin_Click(object sender, ImageClickEventArgs e)
        //{
        //    if (txtCode.Value != mycode.Value)
        //    {
        //        LTP.Common.MessageBox.Show(this.Page, "验证码错误。");
        //        return;
        //    }
        //    bool Authenticated = false;
        //    string userName = LTP.Common.PageValidate.InputText(txtName.Value.Trim(), 30);
        //    string Password = LTP.Common.PageValidate.InputText(txtpwd.Value.Trim(), 30);
        //    Authenticated = SiteLevelCustomAuthenticationMethod(userName, Password);

        //    if (Authenticated == true)
        //    {
        //        //Session["BangShangLogin_model"] = new TCS.BLL.MemberInfo().GetMemberLogin(userName);
        //        Response.Redirect("~/membershome/index.aspx");
        //    }
        //    else
        //    {
        //        LTP.Common.MessageBox.Show(this.Page,"登录失败,请检查用户名密码。");
        //    }
        //}
    }
}
